Skip to main content
ICT
A16 - Single Dimension Arrays
 
Main Previous Next
Title Page >  
Summary >  
Lesson A1 >  
Lesson A2 >  
Lesson A3 >  
Lesson A4 >  
Lesson A5 >  
Lesson A6 >  
Lesson A7 >  
Lesson A8 >  
Lesson A9 >  
Lesson A10 >  
Lesson A11 >  
Lesson A12 >  
Lesson A13 >  
Lesson A14 >  
Lesson A15 >  
Lesson A16 >  
Lesson A17 >  
Lesson A18 >  
Lesson A19 >  
Lesson A20 >  
Lesson A21 >  
Lesson A22 >  
Lesson AB23 >  
Lesson AB24 >  
Lesson AB25 >  
Lesson AB26 >  
Lesson AB27 >  
Lesson AB28 >  
Lesson AB29 >  
Lesson AB30 >  
Lesson AB31 >  
Lesson AB32 >  
Lesson AB33 >  
Vocabulary >  
 

E. Arrays and Algorithms page 7 of 10

In the following list, we introduce five important algorithms that are quite common in programs that analyze data in arrays. You will meet these again in later lessons and labs.

  1. Insertion is a standard problem that must be solved for all data structures. Suppose an array had 10 values and an 11th value was to be added. We are assuming the array can store at least 11 values.

    1. If we could place the new value at the end, there would be no problem.

    2. But if the new value must be inserted at the beginning of the list in position 0, the other 10 values must be moved one cell over in the list.

  2. Deletion of a value creates an empty cell that probably must be dealt with. The most likely solution, after deleting a value, is to move all values that are to the right of the empty spot one cell to the left.

  3. A traversal of an array consists of visiting every cell location, probably in order. The visit could involve printing out the array, initializing the array, finding the largest or smallest value in the array, etc.

  4. Sorting an array means to organize values in either ascending or descending order. These algorithms will be covered in depth in future lessons.

  5. Searching an array means to find a specific value in the array. There are several standard algorithms for searching an array. These will be covered in future lessons.

 

Main Previous Next
Contact
 © ICT 2006, All Rights Reserved.